// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).


beginscenarioscript;

variables;

body;


//This state is called every time the scenario is loaded.
beginstate LOAD_SCEN_STATE;

	//debug mode... commented out for release
	//turn_on_debug_mode();

	//Set up quests
	init_quest(0,"Speak With the Mayor","You are to speak with Mayor Skellick of Stonesthrow to learn more about the mission you came here to accept.");
	init_quest(1,"Break the Siege","By whatever means necessary, you are to break the siege of Copperpeak and drive off the Darkside Loyalists.");
	init_quest(2,"Kill Trevahn","Trevahn is the leader of the Darkside Loyalists besieging Copperpeak. Commander Fisher wants you to kill him, however necessary.");
	
	//Set up special items
	
	
	//Set up cutsom abilities


	//Set town visibility
	if(get_flag(4,2) == 3) //if the watchtower is on fire
		set_town_visibility(3,0);

	
	//Reset flags for outdoor terrain changes
	if(get_flag(52,3) == 1) //ships, o2
		set_flag(52,3,0);


break;


//This state is called only once at the very beginning of the scenario.
beginstate START_SCEN_STATE;

	//Set up the scenario's boats.
	create_boat(0,2,31,24,1); //starting boat at the docks
	create_boat(1,2,35,27,1); //other boat at the docks
	create_boat(2,2,32,17,1); //other boat at the docks
	create_boat(3,5,23,17,0); //boat at the Copperpeak docks

	//Creating the scenario's shops
	// --Shop 0, Smoking Halberd Sandwiches--
	add_item_to_shop(0,12,500); //Deli Sandwich

	// --Shop 1, Elena's Food--
	add_item_to_shop(1,4,500); //Bread
	add_item_to_shop(1,6,500); //Greens
	add_item_to_shop(1,7,500); //Steak
	add_item_to_shop(1,8,500); //Dried Meat
	add_item_to_shop(1,11,500); //Fish
	add_item_to_shop(1,397,500); //Pears
	add_item_to_shop(1,398,500); //Apples
	add_item_to_shop(1,399,1); //Cake

	// --Shop 2, Skip's Smithing--
	add_item_to_shop(2,46,10); //Iron Dagger
	add_item_to_shop(2,51,7); //Iron Short Sword
	add_item_to_shop(2,55,2); //Bronze Longsword
	add_item_to_shop(2,66,1); //Iron Spear
	add_item_to_shop(2,75,1); //Bronze Halberd
	add_item_to_shop(2,86,15); //Iron Javelin
	add_item_to_shop(2,122,2); //Iron Buckler
	add_item_to_shop(2,127,3); //Iron Small Shield
	add_item_to_shop(2,141,3); //Bronze Helmet
	add_item_to_shop(2,142,1); //Iron Helmet
	add_item_to_shop(2,158,1); //Gauntlets
	add_item_to_shop(2,31,2); //Iron Studded Armor
	
	// --Shop 3, Demarkus's Workshop--
	add_item_to_shop(3,174,5); //Lockpicks
	add_item_to_shop(3,159,2); //Tongs
	add_item_to_shop(3,158,5); //Pincers
	
	// --Shop 4, Tyler's Spells--
	add_item_to_shop(4,2001,3); //Light up to 3
	add_item_to_shop(4,2003,3); //Spray Acid up to 3
	add_item_to_shop(4,3000,3); //Healing up to 3
	add_item_to_shop(4,3001,3); //Curing up to 3
	
	// --Shop 5, Tyler's Alchemy
	add_item_to_shop(5,4000,1); //Healing Potion
	add_item_to_shop(5,4001,1); //Curing Potion
	add_item_to_shop(5,4002,1); //Haste Potion
	add_item_to_shop(5,4003,1); //Energy Potion
	add_item_to_shop(5,4004,1); //Strength Potion
	add_item_to_shop(5,4005,1); //Graymold Salve
	
	

	//(Leaving the default shops in, but they aren't used)
	//add_item_to_shop(0,25,25);
	//add_item_to_shop(0,26,20);
	//add_item_to_shop(0,30,20);
	//add_item_to_shop(0,31,10);
	//add_item_to_shop(0,35,10);
	//add_item_to_shop(0,121,15);
	//add_item_to_shop(0,122,15);
	//add_item_to_shop(0,126,3);
	//add_item_to_shop(0,131,2);
	//add_item_to_shop(0,111,15);
	//add_item_to_shop(0,16,10);
	//add_item_to_shop(0,136,10);
	//add_item_to_shop(0,137,10);
	//add_item_to_shop(0,141,5);
	// Shop 1 - weapons
	//add_item_to_shop(1,45,25);
	//add_item_to_shop(1,46,20);
	//add_item_to_shop(1,50,15);
	//add_item_to_shop(1,51,10);
	//add_item_to_shop(1,55,5);
	//add_item_to_shop(1,65,20);
	//add_item_to_shop(1,66,10);
	//add_item_to_shop(1,70,5);
	// Shop 2 - tools
	//add_item_to_shop(2,170,500);
	//add_item_to_shop(2,171,500);
	//add_item_to_shop(2,172,30);
	//add_item_to_shop(2,174,500);
	//add_item_to_shop(2,177,500);
	// Shop 3 - missiles
	//add_item_to_shop(3,85,500);
	//add_item_to_shop(3,86,10);
	//add_item_to_shop(3,90,10);
	//add_item_to_shop(3,95,3);
	//add_item_to_shop(3,100,20);
	//add_item_to_shop(3,101,10);
	//add_item_to_shop(3,105,10);
	// Shop 4 - potions
	//add_item_to_shop(4,220,4);
	//add_item_to_shop(4,221,3);
	//add_item_to_shop(4,222,3);
	//add_item_to_shop(4,223,2);
	// Shop 5 - food
	//add_item_to_shop(5,4,500);
	//add_item_to_shop(5,6,500);
	//add_item_to_shop(5,7,500);

break;


// This state is called every tick wherever the party is in the scenario.
beginstate START_STATE;

break;


beginstate 10; //blocks PCs from entering squares w/ beds on them
	block_entry(1);
break;